#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    int n,j,k;
    cin>>n>>j>>k;
    vector<int> v(n+1);
    int mx=0;
    for(int i=1;i<=n;i++)
    {
        cin>>v[i];
        mx=max(mx,v[i]);
    }
    if(v[j]==mx)cout<<"YES"<<endl;
    else  
    {
        if(k!=1)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T=1;
    cin>>T;
    while(T--)
    {
       solve();
    }
    return 0;
}